<?php
/**
 * @copyright © 2022 by 技术先锋 All rights reserved
 * @created   by PhpStorm.
 * @author    starsphp
 * @date      2023/3/23
 * @time      16:58
 */

require_once __DIR__ . '/vendor/autoload.php';

use utils\server\http\AdapterHttpServer;
use Workerman\Worker;

AdapterHttpServer::init();

$http_worker                = new Worker('http://0.0.0.0:8080');
$http_worker->count         = 8;
$http_worker->name          = 'AdapterMan';

$http_worker->onWorkerStart = static function () {
    //init();
    require_once __DIR__.'/start.php';
    // require __DIR__.'/public/index.php';
};

$http_worker->onMessage = static function ($connection, $request) {
    
    // require_once __DIR__.'/start.php';
    $connection->send(\think\run());
};

Worker::runAll();
